package com.kason.framework.factory;

import com.kason.framework.Protocol;
import com.kason.framework.protocol.dubbo.DubboProtocol;
import com.kason.framework.protocol.http.HttpProtocol;

/**
 * @author 卢清波
 * @date 2021/2/19 18:51
 */
public class ProtocolFactory
{
    public static Protocol getProtocol()
    {
        String name = System.getProperty("protocolName");
        if (name == null || name.equals("")) name = "http";
        switch (name) {
            case "http":
                return new HttpProtocol();
            case "dubbo":
                return new DubboProtocol();
            default:
                break;
        }
        return new HttpProtocol();


    }


}
